<?php

namespace app\common\model\common;

use app\common\model\CommonBaseModel;
use app\common\utils\MysqlUtils;

class CommonConfig extends CommonBaseModel
{
    /*
    CREATE TABLE `common_config` (
      `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
      `key` varchar(50) NOT NULL DEFAULT '' COMMENT 'key',
      `name` varchar(50) NOT NULL DEFAULT '' COMMENT '名称',
      `value` text COMMENT '值',
      `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除:0未删除,1已删除',
      `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
      `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共配置';
    */

    public static function getValueByKey($key)
    {
        return parent::where('key', $key)->value('value');
    }
}